﻿
using zijian666.WorkScheduler.Abstractions;

namespace zijian666.WorkScheduler.Defaults;

/// <summary>
/// 工作组默认实现。
/// </summary>
public readonly record struct WorkGroup : IWorkGroup
{
    public WorkGroup(string id, int maxConcurrency)
    {
        id.ThrowIfNullOrWhiteSpace(nameof(id));
        if (maxConcurrency <= 0)
        {
            throw new ArgumentOutOfRangeException(nameof(maxConcurrency));
        }
        Id = id;
        MaxConcurrency = maxConcurrency;
    }
    /// <inheritdoc />
    public string Id { get; }
    /// <inheritdoc />
    public int MaxConcurrency { get; }

    /// <inheritdoc />
    public string? Description { get; init; }

    /// <inheritdoc />
    public object? Arguments { get; init; }
}
